package yt.demo.appcoresystem.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import yt.demo.appcommondb.base.BaseEntity;
import yt.demo.appcoresystem.impl.FileService;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(name = "SystemUploadFile", description = "上传文件信息")
public class SystemUploadFile  extends BaseEntity<SystemUploadFile> {

    @TableId
    @Schema(name = "id", description = "主键ID")
    @NotNull(groups = UpdateGroup.class,message = "id不能为空") // 更新时确保此字段不能为空
    private Long id;

    @Schema(name = "storage_mode", description = "存储模式 (1 本地 2 阿里云 3 七牛云 4 腾讯云)")
    private Integer storageMode;

    @Schema(name = "origin_name", description = "原文件名")
    private String originName;

    @Schema(name = "object_name", description = "新文件名")
    private String objectName;

    @Schema(name = "hash", description = "文件hash")
    private String hash;

    @Schema(name = "mime_type", description = "资源类型")
    private String mimeType;

    @Schema(name = "storage_path", description = "存储目录")
    private String storagePath;

    @Schema(name = "suffix", description = "文件后缀")
    private String suffix;

    @Schema(name = "size_byte", description = "字节数")
    private String sizeByte;

    @Schema(name = "size_info", description = "文件大小")
    private String sizeInfo;

    @Schema(name = "url", description = "url地址")
    private String url;

    @Schema(name = "remark", description = "备注")
    private String remark;

    @TableField(exist = false)
    @Schema(name = "full_url", description = "带域名的URL地址")
    private String fullUrl;

}
